package br.ufpb.di.knowledgetv.sqtv.utils;

import java.util.ArrayList;
import java.util.HashMap;

public class Data {
	private HashMap<String, Object> data = new HashMap<String, Object>();
	private ArrayList<String> errors = new ArrayList<String>();
	
	public void addData(String key, Object value) {
		this.data.put(key, value);
	}
	
	public Object getData(String key) {
		return this.data.get(key);
	}
	
	public Boolean hasErrors() {
		return !this.errors.isEmpty();
	}

    public Boolean hasData(String key) {
        return this.data.containsKey(key);
    }
	
	public void addError(String error) {
		this.errors.add(error);
	}
	
	public ArrayList<String> getErrors() {
		return this.errors;
	}
	
}
